A method of detecting a distance to an object by a time of flight (TOF) method is known. For example, PTL 1 discloses a device that detects a three-dimensional shape of an object by illuminating the object with light. The device performs a pre-ranging and automatically adjusts an exposure timing based on the result of the pre-ranging.
PTL 2 discloses a device which calculates a distance by emitting intensity-modulated light to an object at plural light-emitting timings and detecting reflection light reflected on the object at the respective timings.